﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace AppSettingsLib
{
	public class AppSettings : AppSettingsBase
	{
		#region Data members
		// used to seed the base constructor
		private	const string APP_DATA_FOLDER	= "VideoAutoLoader";
		private const string APP_DATA_FILENAME	= "Settings.xml";
		private const string FILE_COMMENT		= "Shared User Seettings";
		// actual data
        protected string m_videoplayerpath = "C:\\";
        protected string m_videoplayerloacationdefault = "C:\\";
		#endregion Data members

		#region Properties
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Get/set name
		/// </summary>
		public string VideoPlayer
		{
            get { return m_videoplayerpath; }
            set { m_videoplayerpath = value; }
		}
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Get/set age
		/// </summary>
		public string VideoPlayerLocationDefault
		{
            get { return m_videoplayerloacationdefault; }
            set { m_videoplayerloacationdefault = value; }
		}
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Get/set old
		/// </summary>
        //public bool Old
        //{
        //    get { return m_old; }
        //    set { m_old = value; }
        //}
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Get/set data as XElement object
		/// </summary>
        public override XElement XElement
        {
            get
            {
                return new XElement(m_settingsKeyName,
                                    new XElement("VideoPlayer", VideoPlayer),
                                    new XElement("VideoPlayerLocationDefault", VideoPlayerLocationDefault));
            }
            set
            {
                VideoPlayer = value.Element("VideoPlayer").Value;
                VideoPlayerLocationDefault = value.Element("VideoPlayerLocationDefault").Value;
            }
        }
		#endregion Properties

		#region Constructors
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="isDefault"></param>
		/// <param name="value"></param>
		public AppSettings(string settingsKeyName/*, XElement element*/)
			: base(APP_DATA_FOLDER, APP_DATA_FILENAME, settingsKeyName, FILE_COMMENT/*, element*/)
		{
		}
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="isDefault"></param>
		/// <param name="value"></param>
		public AppSettings(string appDataFolder, string appDataFilename, string settingsKeyName, string fileComment/*, XElement element*/)
			: base(appDataFolder, appDataFilename, settingsKeyName, fileComment/*, element*/)
		{
		}
		#endregion Constructors

	}
}
